#coding:utf-8
from base import StringBuffer
import time
def render(year, month, day):
    _ = StringBuffer()
    _(u'''
    <span><select name="year" id='year'>
        <option value=""></option>
    </select>
    <select name="month" id='month'>
        <option value=""></option>
    </select>
    <select name="day" id='day'>
        <option value=""></option>
    </select>
    </span>
    ''')
    t = time.localtime(time.time())
    if year == None : year = t.tm_year
    if month == None : month = t.tm_mon
    if day == None : day = t.tm_mday
    _(u'''
    <script type='text/javascript'>
    $(document).ready(function()
    {
        init_date(document.getElementById('year'), document.getElementById('month'), document.getElementById('day'),
                    %d, %d, %d, %d);
    });
    </script> 
    ''' % (year, month, day, t.tm_year)
    )
    return _.getvalue()